package cn.sh.yhk.acl;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * @Classname Yhk
 * @Description TODO
 * @Version 1.0.0
 * @Date 2024/10/2 16:39
 * @Created by y6522
 */
@Data
public class UserDetailsInfo implements UserDetails {

    private Integer userid;

    private String username;

    private String password;

    private String role;


    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    //判断用户是否过期
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    /*
     *判断用户是否被锁定
     * 一般用于多次登录失败。
     */
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    /*
     *用于判断用户的凭证（密码）是否过期
     */
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    /*
     *判断用户是否被禁用
     */
    @Override
    public boolean isEnabled() {
        return true;
    }
}
